<template>
  <span>
	  <el-select :value="value" placeholder="请选择" @change="change" :clearable="clearable">
	  	<slot name="option"></slot>
	    <el-option
	      v-for="item in options"
	      :key="item.tagsClassifyId"
	      :label="item.classifyName"
	      :value="item.tagsClassifyId">
	    </el-option>
	  </el-select>
  </span>
</template>
<script>
    import {tagsCateSelect} from '@/utils/api'
    export default {
		  props: {
		  	clearable: {
		  		type:Boolean,
		  		default: false
		  	},
				value: Number
		  },
      data(){
          return {
            options: []
          }
      },
      created(){
         this.getData()
      },
      methods: {
      	change (n) {
      		this.$emit('input',n)
      	},
        async getData(){
          this.pload = false
          let Datas = await tagsCateSelect()
          this.options = Datas
          this.pload = true
        },
      }
    }
</script>